package com.mlk.waste.controller;

import com.mlk.core.component.page.Pager;
import com.mlk.core.util.ServerResponse;
import com.mlk.waste.po.EngWasteUserOrderVerify;
import com.mlk.waste.service.EngWasteUserOrderService;
import com.mlk.waste.vo.EngWasteOrderVO;
import com.mlk.waste.vo.EngWasteUserOrderItemVO;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;

/**
 * 废品回收
 */
@Controller
@RequestMapping("/eng/waste/order")
public class EngWasteUserOrderController {

    @Resource
    private EngWasteUserOrderService engWasteUserOrderService;

    /**
     * 返回订单首页
     * @return
     */
    @RequestMapping("index")
    public String index(){
        return "waste/wasteOrder";
    }

    /**
     * 分页数据展示
     * @param vo
     * @return
     */
    @RequestMapping("listPage")
    @ResponseBody
    public Pager listPage(EngWasteOrderVO vo){
        return this.engWasteUserOrderService.listPage(vo);
    }

    /**
     * 查询订单详情
     * @param item
     * @return
     */
    @ResponseBody
    @RequestMapping("listPageItem")
    public Pager listPageItem(EngWasteUserOrderItemVO item){
        return this.engWasteUserOrderService.listPageItem(item);
    }

    /**
     * 查询订单的相关审核意见
     * @param orderCode
     * @return
     */
    @ResponseBody
    @RequestMapping("getAllVerifyAdvice")
    public ServerResponse getAllVerifyAdvice(String orderCode){
        return this.engWasteUserOrderService.getAllVerifyAdvice(orderCode);
    }

    /**
     * 审核成功
     * @param verify
     * @return
     */
    @RequestMapping("verifyOk")
    @ResponseBody
    public ServerResponse verifyOk(EngWasteUserOrderVerify verify){
        return this.engWasteUserOrderService.verifyOk(verify);
    }

    /**
     * 审核失败
     * @param verify
     * @return
     */
    @ResponseBody
    @RequestMapping("verifyFail")
    public ServerResponse verifyFail(EngWasteUserOrderVerify verify){
        return this.engWasteUserOrderService.verifyFail(verify);
    }
}
